<?php
/**
 * Created by PhpStorm.
 * User: extraxue
 * Date: 2018/5/5
 * Time: 下午10:45
 */

?>

<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>文章列表模板</title>
    <link rel="stylesheet" href="bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="css/articlelist.css">
    <script src="bootstrap/js/bootstrap.min.js"></script>

</head>
<body>
<?php

session_start();
require_once('control/pdo.php');

$countNumber = $_GET['countNumber'];
$countNumberTail = ($countNumber * 10);
$countNumberHead = ($countNumber * 10 - 10);

$resultGetNewsType['news_type_name'] = $_SESSION['GetNewsType'];

$sqlGetNewsList = "select * from news_info a where a.news_type = '{$resultGetNewsType['news_type_name']}' and a.status= '1'
order by create_time desc limit $countNumberHead,$countNumberTail";
$rsGetNewsList = $pdo->query($sqlGetNewsList);
$resultGetNewList = $rsGetNewsList->fetch(PDO::FETCH_ASSOC);

?>
<div class="aritcle_main">
    <div class="article_inner">
        <div style="padding-top:10px;"></div>
        <div class="article_inner_title" style="color: #777777">
            <li>当前位置：</li>
            <li><a href="index.php" target="_parent">主页</a></li>
            <li>&nbsp>&nbsp</li>
            <li class="active">部门概况</li>
        </div>
        <div class="clear"></div>
        <div class="article_inner_left" style="padding:0px 10px 10px 10px;">
            <div class="article_inner_left_top">
                <a href="#">理论思想</a>
            </div>

            <div class="clear"></div>
            <!--颜色不同的两根线start-->
            <div class="article_inner_left_top_line1">
            </div>

            <div class="article_inner_left_top_line2">
            </div>
            <!--颜色不同的两根线end-->
            <div class="clear"></div>
            <div class="artice_inner_left_main" style="height: 490px;">
                <?php
                foreach ($pdo->query($sqlGetNewsList) as $key => $resultGetNewList) {
                    ?>
                    <ul style="margin-left: 5px;">
                        <li>
                            <div style="float: left;"><a
                                        href="article.php?uid=<?= $resultGetNewList['uid'] ?>"
                                        target="_blank"
                                        title="<?php echo "$resultGetNewList[news_title]" ?>"><?php echo mb_substr($resultGetNewList['news_title'], 0, 30, "utf-8") ?></a>
                            </div>
                            <span style="float:right;color: #777777;font-size: 8px"><?php echo substr($resultGetNewList['create_time'], 0, 10) ?></span>
                            <div class="clear"></div>
                        </li>
                    </ul>
                    <?php
                }
                ?>


            </div>
            <div class="artice_inner_left_linkage">
                <?php
                if ($countNumber == 1) {
                    ?>
                    <span class="Fir_Page">上一页</span>
                    <?php
                } else {
                    ?>
                    <span class="next_Page_Action">
                    <a href="articlelistNextPage.php?countNumber=<?= $countNumber - 1 ?>">上一页</a></span>
                    <?php
                }
                ?>

                <?php
                $resultGetNewsCount['count'] = $_SESSION['GetNewsCount'];

                $pageCount = floatval($resultGetNewsCount['count']) / 10;

                for ($pageCountA = 0; $pageCountA <= $pageCount; $pageCountA++) {
                    if ($pageCountA + 1 == $countNumber) {
                        ?>
                        <span><a style="color: #777777"
                                 href="articlelistNextPage.php?countNumber=<?= $pageCountA + 1 ?>"><?= $pageCountA + 1 ?></a></span>

                        <?php
                    } else {
                        ?>
                        <a href="articlelistNextPage.php?countNumber=<?= $pageCountA + 1 ?>"><?= $pageCountA + 1 ?></a>
                        <?php
                    }
                    ?>

                    <?php
                }
                if ($countNumber == ($pageCountA)) {
                    ?>
                    <span class="Fir_Page">下一页</span>
                    <?php
                } else {
                    ?>
                    <span class="next_Page_Action">
                    <a href="articlelistNextPage.php?countNumber=<?= $countNumber + 1 ?>">下一页</a></span>
                    <?php
                }
                ?>

            </div>

        </div>

        <div class="article_inner_right">
            <div class="article_inner_right_top">
                <a href="#">宣传栏</a>
            </div>

            <div class="clear"></div>

            <div class="article_inner_right_top_line1">
            </div>
            <div class="article_inner_right_top_line2">
            </div>
            <div class="clear"></div>

            <div class="article_inner_right_main_longbox">
                <div class="img">
                    <a href="#"
                       target="_blank"><img src="css/sbgd.jpg" alt="2.jpg" title=""></a>
                </div>
                <div class="lx-p">
                    <a href="#"
                       target="_blank">身<br>边<br>感<br>动</a>
                </div>
            </div>

            <div class="article_inner_right_main_longbox">
                <div class="img">

                    <a href="#"
                       target="_blank"><img src="css/whdg.jpg" alt="555.jpg" title=""></a>

                </div>
                <div class="lx-p"><a href="#"
                                     target="_blank">文<br>化<br>大<br>观</a></div>
            </div>
            <div class="article_inner_right_main_shortbox">
                <div class="img">
                    <a href="#" target="_blank">
                        <img src="css/lxyz.png">
                    </a>
                </div>
                <div style="height: 10px;"></div>
                <p><a href="#" target="_blank">两学一做</a></p>
            </div>

            <div class="article_inner_right_main_shortbox">
                <div class="img">
                    <a href="#" target="_blank">
                        <img src="css/dzdg.png">
                    </a>
                </div>
                <p><a href="#" target="_blank">党章党规</a></p>
            </div>

            <div class="clear"></div>


            <div class="article_inner_right_main_shortbox">
                <div class="img">
                    <a href="#" target="_blank">
                        <img src="css/xlnxzl.png">
                    </a>
                    <p><a href="#" target="_blank">新理念新思想<br>新战略</a>
                    </p></div>

            </div>

            <div class="article_inner_right_main_shortbox">
                <div class="img">
                    <a href="#" target="_blank">
                        <img src="css/xxdj.png">
                    </a>
                </div>
                <p><a href="#" target="_blank">学习经典</a></p>

            </div>

        </div>
    </div>

</div>

</body>
</html>
